<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>关于 Cover</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <h2 id="add-cover">关于 Cover</h2>

  <p class="h2subheading">- 为您的书选择一个封面 -</p>

  <p>The Add Cover feature allows you to pick an image for your cover and have Sigil automatically make the necessary updates to mark the image as your cover.</p>
  <p>“添加封面”功能使您可以为封面选择图像，并使 Sigil 自动进行必要的更新以将图像标记为封面。</p>

  <p>Add a cover by selecting the menu item <span class="menuitem">Search→Add Cover</span> or its keyboard shortcut:</p>
  <p>通过选择菜单项 <span class ="menuitem">搜索→添加封面</span> 或其键盘快捷键来添加封面：</p>

  <div class="image">
    <img alt="add-cover" src="../Images/add-cover.png"/>
  </div>

  <p>You can pick an image in your EPUB, or use <span class="buttonbox">Other Files</span> to pick one from your computer.</p>
  <p>您可以在 EPUB 中选择一个图像，或使用 <span class ="buttonbox">其他文件</span> 从计算机中选择一个图像。</p>

  <h3 class ="sigil_not_in_toc">详细信息</h3>

  <p>Sigil makes the following changes when you add a cover:</p>
  <p> Sigil 在添加封面时进行了以下更改：</p>

  <ul>
    <li>Creates a <span class="example">cover.xhtml</span> file if one does not exist. If it does exist, it will use the file. If another file with a semantic of Cover exists, it will use that file.</li>
    <li>如果不存在，则创建一个 <span class ="example">cover.xhtml</span> 文件。如果确实存在，它将使用该文件。如果存在另一个语义为 Cover 的文件，它将使用该文件。</li>

    <li>Inserts the necessary HTML code to display and resize your image into the HTML file.</li>
    <li>插入必要的 HTML 代码以显示图像并调整其大小到 HTML 文件中。</li>

    <li>Marks the HTML cover file with the semantic of Cover.</li>
    <li>用 Cover 的语义标记 HTML 封面文件。</li>

    <li>Marks the image file with the semantic of Cover.</li>
    <li>使用 Cover 的语义标记图像文件。</li>
  </ul>

  <h3 class="sigil_not_in_toc">Custom HTML Cover File</h3>
  <h3 class="sigil_not_in_toc">自定义 HTML 封面文件</h3>

  <p>Sigil inserts code in the HTML cover file that allows your cover to be re-sized and displayed on most ereaders, but you may want to use different code. You can edit the code after the file is created, or provide your own code for Sigil to use.</p>
  <p>Sigil 在 HTML 封面文件中插入代码，该代码可以调整封面大小并在大多数电子阅读器上显示，但您可能需要使用其他代码。您可以在文件创建后编辑代码，也可以提供自己的代码供 Sigil 使用。</p>

  <p>This is the HTML code Sigil inserts into the cover file by default:</p>
  <p>这是 Sigil 默认情况下插入封面文件的 HTML 代码：</p>

  <pre class="example">&lt;?xml version="1.0" encoding="UTF-8" standalone="no" ?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
  &lt;title&gt;Cover&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;div style="text-align: center; padding: 0pt; margin: 0pt;"&gt;
    &lt;svg xmlns="http://www.w3.org/2000/svg" height="100%"
    preserveAspectRatio="xMidYMid meet" version="1.1" 
    viewBox="0 0 SGC_IMAGE_WIDTH SGC_IMAGE_HEIGHT" width="100%" 
    xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
      &lt;image width="SGC_IMAGE_WIDTH" height="SGC_IMAGE_HEIGHT" 
      xlink:href="SGC_IMAGE_FILENAME"/&gt;
    &lt;/svg&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>

  <p>To modify the template Sigil uses for the HTML cover file, create a file in your Preferences directory called <span class="example">cover.xhtml</span></p>
  <p>要修改 Sigil 用于 HTML 封面文件的模板，请在“首选项”目录中创建一个名为 <span class ="example">cover.xhtml</span> 的文件。</p>

  <p>You can use certain placeholders in your text and Sigil will replace them with the appropriate values:</p>
  <p>您可以在文本中使用某些占位符，Sigil 会将其替换为适当的值：</p>

  <ul>
    <li><span class="listheading">SGC_IMAGE_FILENAME:</span> this will be replaced by the path to the image in your EPUB.</li>
    <li><span class="listheading">SGC_IMAGE_FILENAME：</span>这将替换为 EPUB 中图像的路径。</li>

    <li><span class="listheading">SGC_IMAGE_WIDTH:</span> this will be replaced by the width in pixels of your image.</li>
    <li><span class="listheading">SGC_IMAGE_WIDTH：</span>这将被替换为图像的像素宽度。</li>

    <li><span class="listheading">SGC_IMAGE_HEIGHT:</span> this will be replaced by the height in pixels of your image.</li>
    <li><span class="listheading">SGC_IMAGE_HEIGHT：</span>这将由图像的高度（以像素为单位）代替。</li>
  </ul>
</body>
</html>